Skip to content

feat: add Jina search and read support - #32

Merged
oritwoen merged 6 commits into
mainfrom
feat/jina-search-read
May 20, 2026
Merged

feat: add Jina search and read support#32
oritwoen merged 6 commits into
mainfrom
feat/jina-search-read

Conversation

@oritwoen

Copy link
Copy Markdown
Member

Adds Jina as search provider through s.jina.ai, wired into registry, default detection, CLI/tool surfaces, and docs. Also adds first read capability with readUrl + askweb read/askweb_read, backed by Jina Reader at r.jina.ai - URL to content stays separate from query to results, so scope doesn't get muddy.

@coderabbitai

coderabbitai Bot commented May 20, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Rate limit exceeded

@oritwoen has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 23 minutes and 12 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e541d9f2-daa4-4102-a994-b0fad1648963

📥 Commits

Reviewing files that changed from the base of the PR and between 16953c1 and 6b9aeb7.

📒 Files selected for processing (12)
  • AGENTS.md
  • README.md
  • packages/pi/extensions/askweb.ts
  • src/commands/read.ts
  • src/core/read.ts
  • src/core/types.ts
  • src/index.ts
  • src/providers/jina.ts
  • test/unit/ai-tool.test.ts
  • test/unit/jina.test.ts
  • test/unit/read-command.test.ts
  • test/unit/read.test.ts
📝 Walkthrough

Walkthrough

This PR adds URL reading capability to askweb via the new Jina provider. It introduces ReadResult/ReadOptions types, a readUrl orchestrator that routes to providers, implements the Jina provider with both search and read methods, exposes read functionality through AI SDK tools and CLI commands, and includes comprehensive test coverage and documentation updates.

Changes

Read Capability

Layer / File(s) Summary
Read type contracts and error classes
src/core/types.ts, src/core/errors.ts, src/index.ts
ReadResult interface with title/description/text/html/media/publishedDate/metadata fields; ReadOptions with format/token/selector/timeout/cache controls; SearchProvider.read?() optional method; ProviderConfig.readBaseURL field; new error types EmptyUrlError (whitespace/empty URL) and ReadNotSupportedError (provider lacks read).
Read URL orchestration and provider registry
src/core/read.ts, src/core/providers.ts, src/core/resolve.ts
readUrl(url, options?) entry point trims/validates URL, selects provider (default jina or from options), checks provider has read method, delegates to provider.read(). builtinProviders array includes 'jina'. envKeys maps JINA_API_KEYjina for environment-based detection.
Jina provider implementation
src/providers/jina.ts, src/providers/index.ts
New Jina provider with search (enforces API key, builds query params for domain/category/type, maps response to SearchResult, clamps maxResults) and read (no API key required, encodes target URL into request, builds X-* headers for format/tokens/selectors/timeout/cache, maps response including images/links/text/html/metadata to ReadResult). Registered under jina name.
AI SDK readTool and searchTool
src/ai.ts
Export readTool with Zod schema (URL + optional provider/format/tokens/selector/timeout/cache), validates non-empty URL, delegates to readUrl. Update searchTool description to clarify supported provider set and parallel-search behavior.
OpenCode plugin askweb_read tool
packages/pi/extensions/askweb.ts
Add askweb_read tool to extension with ReadDetails result type, readParameters TypeBox schema, validation/normalization helpers (isKnownReadProvider, normalizeReadFormat, stripUndefinedRead), rendering helpers (formatReadResult, renderReadCall). Update askweb tool guidance for provider selection. Wire tool to call askweb.readUrl().
CLI read subcommand
src/cli-args.ts, src/cli.ts, src/commands/read.ts
Recognize 'read' in normalizeMainArgs. Register read subcommand in CLI. Implement read command with URL validation, --format (markdown/text/html) and --max-tokens parsing, --json output mode, and error mapping (EmptyUrlError → message, AuthError → env var hint, UnknownProviderError → available list, ReadNotSupportedError → message). Local parse helpers for positive integers, format values, and line truncation.
Documentation and test suite
README.md, package.json, test/*
README adds readUrl usage, AI SDK tool docs (readTool/searchTool shapes), Pi extension tool/command inventory, CLI read/providers commands with flags/defaults, provider matrix with Jina details, result shape and optional-field tables, error normalization clarification, ReadResult/ReadOptions data model. Package description updated to "web search and read". 8 test suites: Jina provider (search/read, auth, headers, response mapping), readUrl (provider selection, validation, errors), readTool (default Jina, headers, empty URL rejection), read command (args forwarding, JSON output, error messages), and environment/provider detection updates.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

The PR is substantial but follows a clear pattern: one new provider (Jina) plugged into existing abstractions. The logic is straightforward—URL validation, HTTP request building, response mapping—with no algorithmic complexity. Heterogeneity is low: all changes serve the same feature without conflicting patterns. Test coverage is comprehensive and mirrored closely to implementation (reduces surprise risk). The main review checkpoints are the Jina provider impl and the error handling paths in the CLI.

Possibly related PRs

  • oritwoen/askweb#30: Extended normalizeMainArgs and CLI arg handling in both PRs; #30 introduced the base askweb normalization flow that #32 leverages for the read subcommand.
  • oritwoen/askweb#31: Both modify packages/pi/extensions/askweb.ts; #31 introduced the Pi integration foundation that #32 extends with the new askweb_read tool and related formatting/validation.

Poem

🌐 A Jina joins the squad—no keys to read
Fetch and parse the web at CLI speed
Search, then read: from URL to stone-cold text
Tools and types and tests—what's next?

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed Title accurately summarizes the main change: adding Jina as a search and read provider with full integration.
Description check ✅ Passed Description relates directly to the changeset, explaining Jina integration via s.jina.ai for search and r.jina.ai for read.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/jina-search-read
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch feat/jina-search-read

Warning

Billing warning: we have not been able to collect payment for this subscription for more than 72 hours. Please update the payment method or pay any pending invoices in Billing to avoid service interruption.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/core/read.ts`:
- Around line 5-7: ReadUrlOptions currently declares provider?: string which
defers provider-name validation to runtime (create() throws); change provider to
a literal union of valid provider names (or reference an existing
ProviderName/ProviderType alias) instead of string — update the ReadUrlOptions
declaration (extending ReadOptions) to use that union, and ensure all callers
compile by using the union values; if a ProviderName type does not exist, add
one (e.g., type ProviderName = 's3' | 'gcs' | 'azure' | ...) and use provider?:
ProviderName so invalid provider names are caught at compile time.

In `@src/core/types.ts`:
- Around line 34-35: The public type for the fields links and images currently
allows either string[] or Record<string,string>, which forces callers to branch;
change the public contract in src/core/types.ts so links: string[] and images:
string[] (single normalized shape), and update each provider adapter/transform
code that populates those fields to convert any Record<string,string> shapes
into a flat array of URL strings (e.g., Object.values or mapping keys->values)
before assigning to the public model; keep internal/provider types if needed but
do not expose them on the public interface.

In `@test/unit/ai-tool.test.ts`:
- Around line 254-279: The test for readTool should not rely on the external
JINA_API_KEY environment variable; update the test to explicitly control
process.env.JINA_API_KEY around the call to readTool.execute (or clear it) so
headers are deterministic for mockGetJSON assertions. Locate the
describe('readTool') block and, in the it('reads a URL with Jina by default')
test, set process.env.JINA_API_KEY = undefined (or save and restore the previous
value) before invoking readTool.execute and restore the original value after the
assertion to ensure mockGetJSON.mock.calls[0][1] only contains Accept and
X-Respond-With headers.

In `@test/unit/read-command.test.ts`:
- Around line 56-57: Replace the unsafe type assertions: change the object cast
to use TypeScript's "satisfies ReadRunInput" so the value is type-checked rather
than asserted, remove the non-null assertion on readCommand.run and add a
runtime guard that throws if readCommand.run is undefined (e.g., if
(!readCommand.run) throw new Error('readCommand.run is not defined')), and
update the process.exit mock to have a properly typed callback that accepts an
optional code parameter (string | number | null) and throws a sentinel Error
(instead of using "as never") so the test fails via the thrown error.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 89711c0d-1f4d-4e79-bd54-ccc6c5bd8313

📥 Commits

Reviewing files that changed from the base of the PR and between 200e74d and 16953c1.

📒 Files selected for processing (26)
  • README.md
  • package.json
  • packages/pi/extensions/askweb.ts
  • src/ai.ts
  • src/cli-args.ts
  • src/cli.ts
  • src/commands/read.ts
  • src/core/errors.ts
  • src/core/providers.ts
  • src/core/read.ts
  • src/core/resolve.ts
  • src/core/types.ts
  • src/index.ts
  • src/opencode.ts
  • src/providers/index.ts
  • src/providers/jina.ts
  • test/index.test.ts
  • test/unit/ai-tool.test.ts
  • test/unit/all.test.ts
  • test/unit/cli-args.test.ts
  • test/unit/jina.test.ts
  • test/unit/providers-command.test.ts
  • test/unit/read-command.test.ts
  • test/unit/read.test.ts
  • test/unit/resolve-async.test.ts
  • test/unit/resolve.test.ts
📜 Review details
🧰 Additional context used
📓 Path-based instructions (8)
{build.config.ts,package.json}

📄 CodeRabbit inference engine (AGENTS.md)

Keep entries and exports aligned between build.config.ts and package.json for build outputs

Files:

  • package.json
package.json

📄 CodeRabbit inference engine (AGENTS.md)

Default to minimal dependencies; only add HTTP/cache abstraction layers when provider adapters are being integrated

Files:

  • package.json
test/**/*.test.ts

📄 CodeRabbit inference engine (AGENTS.md)

test/**/*.test.ts: Mirror public behavior in tests, not implementation details
Do not make tests depend on external services; use mocks or fixtures instead

Files:

  • test/unit/resolve-async.test.ts
  • test/unit/providers-command.test.ts
  • test/unit/all.test.ts
  • test/unit/read.test.ts
  • test/unit/resolve.test.ts
  • test/unit/ai-tool.test.ts
  • test/unit/cli-args.test.ts
  • test/unit/jina.test.ts
  • test/unit/read-command.test.ts
  • test/index.test.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx,js,jsx}: Package must be ESM-only with no CommonJS output
Do not introduce CommonJS compatibility shims; maintain ESM-only output

Files:

  • test/unit/resolve-async.test.ts
  • test/unit/providers-command.test.ts
  • src/cli-args.ts
  • src/providers/index.ts
  • src/cli.ts
  • test/unit/all.test.ts
  • test/unit/read.test.ts
  • test/unit/resolve.test.ts
  • src/core/read.ts
  • src/core/providers.ts
  • test/unit/ai-tool.test.ts
  • src/core/errors.ts
  • test/unit/cli-args.test.ts
  • src/core/types.ts
  • src/core/resolve.ts
  • test/unit/jina.test.ts
  • src/ai.ts
  • src/opencode.ts
  • src/commands/read.ts
  • test/unit/read-command.test.ts
  • packages/pi/extensions/askweb.ts
  • test/index.test.ts
  • src/providers/jina.ts
  • src/index.ts
**/*.ts

📄 CodeRabbit inference engine (AGENTS.md)

Do not use as any, @ts-ignore, or placeholder unsafe type assertions anywhere in the codebase

Files:

  • test/unit/resolve-async.test.ts
  • test/unit/providers-command.test.ts
  • src/cli-args.ts
  • src/providers/index.ts
  • src/cli.ts
  • test/unit/all.test.ts
  • test/unit/read.test.ts
  • test/unit/resolve.test.ts
  • src/core/read.ts
  • src/core/providers.ts
  • test/unit/ai-tool.test.ts
  • src/core/errors.ts
  • test/unit/cli-args.test.ts
  • src/core/types.ts
  • src/core/resolve.ts
  • test/unit/jina.test.ts
  • src/ai.ts
  • src/opencode.ts
  • src/commands/read.ts
  • test/unit/read-command.test.ts
  • packages/pi/extensions/askweb.ts
  • test/index.test.ts
  • src/providers/jina.ts
  • src/index.ts
src/**/*.ts

📄 CodeRabbit inference engine (AGENTS.md)

src/**/*.ts: Prefer normalized data models over provider-shaped raw objects in public API
Keep provider names and capability flags as literal unions rather than strings or enums
Do not leak provider-specific response formats into the public API; normalize all provider outputs
Do not couple CLI formatting logic with core data models; keep them separate

Files:

  • src/cli-args.ts
  • src/providers/index.ts
  • src/cli.ts
  • src/core/read.ts
  • src/core/providers.ts
  • src/core/errors.ts
  • src/core/types.ts
  • src/core/resolve.ts
  • src/ai.ts
  • src/opencode.ts
  • src/commands/read.ts
  • src/providers/jina.ts
  • src/index.ts
src/cli.ts

📄 CodeRabbit inference engine (AGENTS.md)

src/cli.ts: Extend CLI functionality using citty subcommands in src/cli.ts; keep text and JSON output formats stable
CLI should be thin and delegate reusable functions to src/index.ts instead of implementing network or core logic directly
CLI must support both human-readable and machine-readable JSON output formats
Do not add network code directly in the CLI; delegate HTTP requests to core modules from src/index.ts

Files:

  • src/cli.ts
src/index.ts

📄 CodeRabbit inference engine (AGENTS.md)

Keep the public API surface small and explicit; manage all public exports through the barrel export at src/index.ts

Files:

  • src/index.ts
🧠 Learnings (2)
📚 Learning: 2026-03-10T19:51:47.772Z
Learnt from: aeitwoen
Repo: oritwoen/websxa PR: 5
File: packages/opencode-websxa/package.json:39-40
Timestamp: 2026-03-10T19:51:47.772Z
Learning: In the oritwoen/websxa repo, using "latest" for devDependencies (e.g., obuild, typescript, vitest) is intentional and consistent across all workspace packages, including the root package.json. Do not treat this as a reproducibility issue during reviews. When reviewing package.json files across the monorepo, accept the use of "latest" for devDependencies and focus on other stability indicators (e.g., CI, lockfile integrity) instead.

Applied to files:

  • package.json
📚 Learning: 2026-03-18T13:22:47.573Z
Learnt from: oritwoen
Repo: oritwoen/websxa PR: 29
File: src/core/errors.ts:100-101
Timestamp: 2026-03-18T13:22:47.573Z
Learning: In src/core/errors.ts, keep the HAS_OFFSET_RE guard (hasTime && !HAS_OFFSET_RE.test(value)) in validateDateFilters as defense-in-depth. Do not flag this as dead/redundant code even though ISO_DATE_RE enforces offset now, because future regex changes could weaken or alter the guarantee. Treat this as intentional,Reviewed code that should not be removed or simplified during reviews.

Applied to files:

  • src/core/errors.ts
🔇 Additional comments (25)
README.md (1)

8-13: LGTM!

Also applies to: 47-48, 83-100, 103-107, 111-123, 125-125, 129-129, 138-138, 146-146, 154-154, 162-162, 167-170, 179-179, 186-186, 191-191, 197-197, 227-227, 233-233, 252-252, 254-270, 285-285, 287-298

package.json (1)

4-4: LGTM!

test/index.test.ts (1)

2-2: LGTM!

Also applies to: 10-10, 15-15, 20-22

test/unit/ai-tool.test.ts (1)

18-20: LGTM!

Also applies to: 65-65, 281-291

test/unit/all.test.ts (1)

53-53: LGTM!

Also applies to: 377-377

test/unit/cli-args.test.ts (1)

7-7: LGTM!

test/unit/jina.test.ts (1)

1-246: LGTM!

test/unit/providers-command.test.ts (1)

14-14: LGTM!

test/unit/read.test.ts (1)

1-35: LGTM!

test/unit/resolve-async.test.ts (1)

11-11: LGTM!

test/unit/resolve.test.ts (1)

5-5: LGTM!

Also applies to: 37-37, 41-41, 53-53, 82-82

src/ai.ts (1)

6-7: LGTM!

Also applies to: 12-12, 15-15, 42-61

src/opencode.ts (1)

7-7: LGTM!

Also applies to: 13-13, 18-18, 35-47

packages/pi/extensions/askweb.ts (1)

7-8: LGTM!

Also applies to: 35-42, 54-54, 56-57, 99-121, 125-125, 128-128, 135-135, 141-141, 233-285, 404-413, 432-442, 506-512, 531-540

src/cli-args.ts (1)

3-3: LGTM!

src/cli.ts (1)

11-11: LGTM!

Also applies to: 15-15

src/commands/read.ts (1)

1-146: LGTM!

src/core/types.ts (1)

25-33: LGTM!

Also applies to: 36-37, 39-46, 51-51, 65-65

src/core/errors.ts (1)

77-94: LGTM!

src/index.ts (1)

7-9: LGTM!

Also applies to: 18-20

src/core/read.ts (1)

1-4: LGTM!

Also applies to: 9-25

src/core/providers.ts (1)

4-4: LGTM!

src/core/resolve.ts (1)

8-8: LGTM!

src/providers/jina.ts (1)

1-185: LGTM!

src/providers/index.ts (1)

3-3: LGTM!

Comment thread src/core/read.ts
Comment thread src/core/types.ts Outdated
Comment thread test/unit/ai-tool.test.ts
Comment thread test/unit/read-command.test.ts Outdated
@augmentcode

augmentcode Bot commented May 20, 2026

Copy link
Copy Markdown
🤖 Augment PR Summary

Summary: This PR adds Jina support as a new built-in provider and introduces first-class URL “read” capability alongside existing query “search”.

Changes:

  • Adds a new jina provider adapter backed by s.jina.ai (search) and r.jina.ai (read)
  • Extends the public types with ReadResult/ReadOptions and exports readUrl
  • Adds new error types (EmptyUrlError, ReadNotSupportedError) for read flows
  • Updates default-provider detection to include JINA_API_KEY
  • Adds an AI SDK readTool and an OpenCode askweb_read tool
  • Extends the CLI with askweb read <url> plus --format/--max-tokens
  • Updates the Pi extension to expose askweb_read and docs/README accordingly
  • Adds unit tests covering Jina search/read mapping and the new read command/tool surface

Technical Notes: Jina search requires Bearer auth via JINA_API_KEY; Jina read is usable without a key but will send Bearer auth when present.

🤖 Was this summary useful? React with 👍 or 👎

@augmentcode augmentcode Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. 2 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

Comment thread src/core/read.ts
Comment thread src/providers/jina.ts

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 issues found across 2 files (changes from recent commits).

Requires human review: This PR introduces a new search provider (Jina) and a new read capability spanning core logic, CLI, AI SDK tools, Pi extension, OpenCode plugin, and tests, which represents a substantial feature addition with broad blast radius and multiple integration points requiring careful human review to...

Re-trigger cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

8 issues found across 26 files

Confidence score: 3/5

  • There is moderate user-impact risk because src/providers/jina.ts has functional gaps: using the wrong read-format header and not validating Jina’s application-level response.code/response.status can silently return wrong content or hide provider-side errors.
  • src/commands/read.ts should sanitize fetched page text before printing; without this, terminal escape sequences from remote content can pass through directly to users.
  • Several findings look non-blocking but still worth fixing soon (src/commands/read.ts provider listing UX, src/core/read.ts error-ordering, test/unit/ai-tool.test.ts env sensitivity, and README.md typing/signature mismatch), which keeps this from feeling like a low-risk merge.
  • Pay close attention to src/providers/jina.ts, src/commands/read.ts, and src/core/read.ts - provider routing/error handling and terminal output safety are the main regression points.
Architecture diagram
sequenceDiagram
    participant CLI as CLI / Commands
    participant TUI as Pi Extension / OpenCode
    participant AI as AI SDK Tool
    participant Read as core/read.ts
    participant Registry as core/registry.ts
    participant JinaProv as Jina Provider
    participant JinaAPI as s.jina.ai / r.jina.ai
    participant SearchProv as Search Providers
    participant Errors as core/errors.ts

    Note over CLI,JinaAPI: NEW: Read flow (URL-to-content)

    CLI->>CLI: askweb read <url> --format markdown
    CLI->>Read: readUrl(url, { provider, format, maxTokens })
    Read->>Registry: create(providerName)
    Registry-->>Read: JinaProvider instance
    Read->>JinaProv: provider.read(url, readOptions)
    alt Read without API key (basic)
        JinaProv->>JinaAPI: GET r.jina.ai/url with Accept: application/json
    else Read with JINA_API_KEY
        JinaProv->>JinaAPI: GET r.jina.ai/url with Authorization: Bearer {key}
    end
    JinaAPI-->>JinaProv: { code, data: { title, content, text, ... } }
    JinaProv->>JinaProv: mapReadResult() → normalized ReadResult
    JinaProv-->>Read: ReadResult { url, title, content, ... }
    Read-->>CLI: ReadResult
    CLI->>CLI: Output formatted result or JSON

    Note over TUI,AI: NEW: Tool/extension integration

    alt Pi extension tool call
        TUI->>TUI: askweb_read.execute({ url, provider, format, ... })
        TUI->>Read: askweb.readUrl(url, options)
        Read-->>TUI: ReadResult
        TUI->>TUI: formatReadResult() with header
        TUI-->>TUI: Return agent tool result
    else OpenCode plugin call
        TUI->>TUI: askweb_read.execute({ url, provider, format })
        TUI->>Read: readUrl(url, { provider, format, maxTokens })
        Read-->>TUI: ReadResult
        TUI->>TUI: encode(ReadResult)
    else AI SDK tool call
        AI->>AI: readTool.execute({ url, format })
        alt Empty URL
            AI->>Errors: throw EmptyUrlError
        end
        AI->>Read: readUrl(url, { provider: 'jina', format, ... })
        Read-->>AI: ReadResult
        AI-->>AI: Return ReadResult
    end

    Note over CLI,JinaAPI: CHANGED: Jina search flow

    CLI->>CLI: askweb search <query> --provider jina
    CLI->>Registry: create('jina', { apiKey: env.JINA_API_KEY })
    Registry-->>CLI: JinaProvider
    CLI->>JinaProv: search(query, { maxResults, category, includeDomains })
    alt Missing API key
        JinaProv->>Errors: throw AuthError
    end
    JinaProv->>JinaAPI: GET s.jina.ai/search?q=... with Bearer auth
    JinaAPI-->>JinaProv: Search results
    JinaProv->>JinaProv: mapSearchResult() → normalized SearchResult
    JinaProv-->>CLI: SearchResult[]

    Note over Registry,Errors: CHANGED: Registry with read capability check

    Registry->>Registry: provider.read() optional method
    alt Provider implements read
        Read->>JinaProv: read() → success
    else Provider has no read method
        Read->>Errors: throw ReadNotSupportedError
    end

    Note over Registry: NEW: ProviderConfig.readBaseURL and deriveReadBaseURL()
Loading

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread src/providers/jina.ts Outdated
Comment thread src/providers/jina.ts Outdated
Comment thread README.md Outdated
Comment thread src/commands/read.ts Outdated
Comment thread src/commands/read.ts Outdated
Comment thread src/core/read.ts
Comment thread src/providers/jina.ts
Comment thread test/unit/ai-tool.test.ts
@oritwoen oritwoen self-assigned this May 20, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 10 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="src/core/read.ts">

<violation number="1" location="src/core/read.ts:6">
P2: This adds another hardcoded read-provider list. Reuse the shared export instead of keeping three copies. If the next reader only updates `src/core/read.ts`, the AI and opencode tools still reject it.</violation>
</file>

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread src/core/read.ts

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 3 files (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread packages/pi/extensions/askweb.ts Outdated

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 issues found across 2 files (changes from recent commits).

Requires human review: Auto-approval blocked by 1 unresolved issue from previous reviews.

Re-trigger cubic

@oritwoen
oritwoen merged commit 75b21ac into main May 20, 2026
2 checks passed
@oritwoen
oritwoen deleted the feat/jina-search-read branch May 20, 2026 11:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant